<template>
  <!--首页轮播组件-->
  <van-swipe :autoplay="3000">
    <van-swipe-item v-for="(item,ls) in list" :key="item.imgurl">  <!--轮播图每一项-->
      <van-image :src="item.imgurl" width="100%" height="200px" @click="gotourl(item.gotourl)">
      </van-image>
    </van-swipe-item>
  </van-swipe>
</template>

<script>
  export default {
    name:"Swipe",
    props:{//向组件内传入的参数列表
      list:Array,
    },
    methods:{
      gotourl:function(url){//路径跳转
        if(!(url=="" || url==undefined || url==null)){//url不是空的
          window.location.href=url
        }
      }
    }
  }
</script>

<style>
</style>
